package com.lc.email.controller;

import com.lc.common.HttpResult;
import com.lc.email.bo.SendEmailBo;
import com.lc.email.service.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/email")
public class EmailController {
    @Autowired
    private EmailService emailService;

    @PostMapping("/{email}/{code}")
    public boolean send(@PathVariable("email") String email, @PathVariable("code") String code){
        SendEmailBo bo = new SendEmailBo();
        bo.setEmail(email);
        bo.setCode(code);
        return emailService.send(bo);
    }
}
